package com.xingxue.service;

import com.xingxue.entity.Module;
import com.xingxue.mapper.ModuleMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ModuleService {

    @Autowired
    private ModuleMapper moduleMapper;

    @Cacheable(cacheNames = "ModuleCache", key = "'module:all'")
    public List<Module> findAll() {
        return moduleMapper.findAll();
    }
}
